package modelo.tp5;

import org.neo4j.cypher.ExecutionEngine;
import org.neo4j.cypher.ExecutionResult;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.kernel.logging.BufferingLogger;


public class ConsultasCypher {
	

	public static String ejecutarConsulta(String consulta, GraphDatabaseService graphDb) {
		 
		String ret = "NADA";
		 ExecutionEngine engine = new ExecutionEngine(graphDb, new BufferingLogger());
		 try ( Transaction ignored = graphDb.beginTx() ){
			 ExecutionResult result = engine.execute( consulta );
			 ret =  result.dumpToString();
		 }
		return ret;
	}
}